<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 1000px;
            height: 500px;
            border: 1px solid red;
            margin: auto;
            margin-top: 100px;
        }
        .box2{
            position: relative;
            width: 600px;
            height: 300px;
            border: 1px solid red;
            margin: auto;
            margin-top: 100px;
        }
        .box3{
            position: absolute;
            width: 400px;
            height: 200px;
            border: 1px solid red;
            left: 100px;
            top: 50px;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">
            <div class="box3">

            </div>
        </div>
    </div>
</body>
<script>
    var box3 = document.querySelector(".box3");

    console.log(box3.getClientRects())
    console.log(box3.getRootNode())
    console.log(box3.getBoundingClientRect())
    box3.onmousemove = function(e){
        console.log(e.target.offsetTop);
    }
</script>
</html>